<template>
  <div class="bg-red-500">
    <u-form labelPosition="left" :model="form">
      <u-form-item label="用户" prop="username" borderBottom>
        <u-input v-model="form.username"></u-input>
      </u-form-item>
      <u-form-item label="密码" prop="password" borderBottom>
        <u-input v-model="form.password"></u-input>
      </u-form-item>
    </u-form>

    <u-button type="primary" @click="login()">登录</u-button>
  </div>
</template>
<script setup lang="ts">
import userStatus from "@/pinia/userStatus";

const form = ref<Record<any, any>>({});
const auth = userStatus();
const login = async () => {
  // await auth.login(form.value);
  const result = await getData({
    q: { zero: new Date(new Date().toLocaleDateString()).getTime() },
    success: "error",
    afters: [
      async (ctx: any) => {
        // console.log(ctx);
      },
    ],
  });
  console.log(result);
};

</script>
<style lang="scss" scoped>
.box {
  width: 100px;
  height: 100px;
}
</style>
